<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>文件添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加信息':action=='Modify'?'修改信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'study_files', 'form': 'dataForm' ,'primary_key':'Study_Files_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">文件信息</div>
        </div>
        <el-descriptions :column="1" size="large" border>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">文件标题</div>
            </template>
            <el-input ref="personal_information" v-model="dataForm.Study_Files_Title" class="borderless-input"
              placeholder="请输入文件标题" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">文件类型</div>
            </template>
            <el-select clearable v-model.trim="dataForm.Study_Files_Category_SerialNumber" placeholder="请选择文件类别"
              filterable style="width: 100%">
              <el-option v-for="(item,index) in category" :key="index" :label="item.Study_Files_Category"
                :value="item.Study_Files_Category_SerialNumber"></el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">展示小程序环境</div>
            </template>
            <el-select clearable v-model.trim="dataForm.Environment_MicroScreen" placeholder="请选择是否展示小程序环境" filterable
              style="width: 100%">
              <el-option v-for="(item,index) in [{label:'是',value:'0'},{label:'否',value:'1'}]" :key="index"
                :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">展示大屏环境</div>
            </template>
            <el-select clearable v-model.trim="dataForm.Environment_BigScreen" placeholder="请选择是否展示大屏环境" filterable
              style="width: 100%">
              <el-option v-for="(item,index) in [{label:'是',value:'0'},{label:'否',value:'1'}]" :key="index"
                :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">文件封面图片</div>
            </template>
            <yl-upload v-model="dataForm.Study_Files_Image_URL"></yl-upload>
          </el-descriptions-item>
          <el-descriptions-item v-if="dataForm.Study_Files_Category_SerialNumber == 'SFC000000000016'">
            <template #label>
              <div class="cell-item">作者</div>
            </template>
            <el-input v-model="dataForm.Author" class="borderless-input"
              placeholder="请输入作者" />
          </el-descriptions-item>
          <el-descriptions-item v-if="dataForm.Study_Files_Category_SerialNumber == 'SFC000000000016'">
            <template #label>
              <div class="cell-item">简介</div>
            </template>
            <el-input  type="textarea" :autosize="{ minRows: 4}" v-model="dataForm.Introduction" class="borderless-input"
            placeholder="请输入简介" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">文件内容</div>
            </template>
            <el-upload v-if="dataForm.Study_Files_Category_SerialNumber == 'SFC000000000016'" class="upload-demo" accept=".pdf" drag :on-change="handleChange" :file-list="fileList"
               :show-file-list="true" :http-request="customUpload" :on-success="handleSuccess" :on-remove="handleRemove"
              :limit="1" >
              <el-icon style="font-size: 67px; color: #c0c4cc; margin: 16px 0 16px; line-height: 50px;" >
                  <Upload-Filled />
              </el-icon>
              <div class="el-upload__text">将文件拖到此处上传，待点击<em>提交</em>后保存</div>
            </el-upload>
            <yl-upload v-else drag v-model="dataForm.Study_Files_Content"></yl-upload>
          </el-descriptions-item>
        </el-descriptions>
        <div class="table_titel">
          <div class="titel">电子书标签</div>
        </div>
        <el-descriptions :column="1" size="large" border>
          <!-- 题材标签 -->
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">标签</div>
            </template>
            <el-form-item prop="Theme_Tag_SerialNumber">
              <el-select clearable v-model="Theme_Tag_SerialNumber" multiple placeholder="请选择电子书标签(可多选)"
                filterable style="width: 100%">
                <el-option v-for="(item, index) in study_files_tag" :key="index" :label="item.Study_File_Tag"
                  :value="item.Study_File_Tag_SerialNumber">
                </el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
        <div id="ChildTable">
          
          <el-descriptions
          :data-options="JSON.stringify({ 'TableName': 'study_files_details', 'form': 'childDataForm1', 'ParentTableName': 'study_files'})"></el-descriptions>  
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'study_files_mapping_tag', 'form': 'childDataForm', 'ParentTableName': 'study_files'})"></el-descriptions>
            
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>